/**
 * @fileoverview Command object for performing an item search.
 */

goog.provide('dkpoints.rpc.commands.GetItemList');

goog.require('dkpoints.rpc.commands');

/**
 * Command object for doing an item search given a (possibly partial) item name or ID.
 * @param {function(!Object)} callback Function to pass server's JSON response.
 * @param {string|number} item The item name or ID to search for.
 * @constructor
 * @extends {dkpoints.rpc.commands.Command}
 */
dkpoints.rpc.commands.GetItemList = function(callback, item) {
  var me = this;
 
  var url = "/apis/item/" + encodeUriComponent(item);
  
  var commandParams = {
    subclass: "GetTierList",
    url: url,
    callback: callback,
    shouldCache: true,
    cacheParam: item,
    shouldBatch: true
  };
  
  // Call the base class constructor.
  dkpoints.rpc.commands.Command.call(me, commandParams);
    
  if(goog.isDef(instanceName)) {
    /**
     * The instance name to match to the cache list
     * @type {string}
     * @public
     */
    me.instanceName = /** @type {string} */ instanceName;
  }
};
goog.inherits(dkpoints.rpc.commands.GetItemList, dkpoints.rpc.commands.Command);

dkpoints.rpc.commands.GetItemList.prototype.getCacheNames = function() {
};

dkpoints.rpc.commands.GetItemList.prototype.handleResponse = function(xhrResponse) {
};

dkpoints.rpc.commands.GetItemList.prototype.handleFromCache = function(cacheData) {

};

/**
 * Add another command to this one to batch requests.
 * @param {dkpoints.rpc.commands.GetItemList} commandToBatch Another one of me to batch together with myself.
 */
dkpoints.rpc.commands.GetItemList.prototype.batch = function(commandToBatch) {
  
};